
# ifndef __DFX_PLUGIN_H__
# define __DFX_PLUGIN_H__

# include "dfxCore.h"
# include "dfxSingleton.h"

namespace DFX
{
    DFXRESULT LoadDLL(const String &dllFile, void *handle);
    DFXRESULT UnloadDLL(void *handle);

    void* GetFunction(const String &funcName, void *handle);

    class DFX_EXPORT Plugin
    {
    protected:

        String  mName;

    public:

        Plugin(const String &name)
            : mName(name)
        {
        }

        virtual ~Plugin()
        {
        }

        const String& GetName() const
        {
            return mName;
        }

        virtual DFXRESULT Load() = 0;
        virtual DFXRESULT Unload() = 0;
    };
}

# endif